package com.erp.shop.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.erp.shop.domain.dto.ErpSellerStoreSelfEvaluationDto;
import com.ruoyi.common.core.annotation.DataColumn;
import com.ruoyi.common.core.annotation.DataPermission;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.shop.api.domain.ErpSellerStoreEmpower;
import com.ruoyi.shop.api.domain.vo.ErpSellerStoreEmpowerVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 卖家店铺授权Mapper接口
 *
 * @author erp
 * @date 2023-03-24
 */
public interface ErpSellerStoreEmpowerMapper
		extends BaseMapperPlus<ErpSellerStoreEmpowerMapper, ErpSellerStoreEmpower, ErpSellerStoreEmpowerVo> {

	@Override
	@DataPermission({ @DataColumn(key = "userName", value = "user_id") })
	<P extends IPage<ErpSellerStoreEmpower>> P selectPage(P page,
                                                          @Param(Constants.WRAPPER) Wrapper<ErpSellerStoreEmpower> queryWrapper);

	@Override
	@DataPermission({ @DataColumn(key = "userName", value = "user_id") })
	List<ErpSellerStoreEmpower> selectList(@Param(Constants.WRAPPER) Wrapper<ErpSellerStoreEmpower> queryWrapper);

    List<Long> getIsEmpowerStoreId();

    List<ErpSellerStoreEmpower> getIsEmpowerStore();

    /**
     * 获取自动刊登的店铺的列表
     * @return
     */
    List<Long> getAutoPublish();

    Long queryBySellerLoginId(@Param("sellerLoginId") String sellerLoginId);

	ErpSellerStoreEmpower selectStoreByStoreUserName(@Param("sellerLoginId")String sellerLoginId);

	ErpSellerStoreEmpower selectAvailableStoreByStoreUserName(@Param("sellerLoginId")String sellerLoginId);

	List<ErpSellerStoreEmpower> selectListByStoreUserName(@Param("sellerLoginId") String sellerLoginId);

	List<String> getBehindErpPayStoreList();

	List<ErpSellerStoreEmpower> selectListById(Long selectListById);

	ErpSellerStoreEmpower selectEmpowerByUserName(@Param("sellerLoginId") String sellerLoginId);

	Page<ErpSellerStoreSelfEvaluationDto> selfOperationAuth(@Param("page") Page page, @Param("dto") ErpSellerStoreSelfEvaluationDto dto);

	ErpSellerStoreEmpower selectDelEmpowerByUserName(@Param("storeUserName")String storeUserName);

	Integer updateDelEmpower(ErpSellerStoreEmpower empower);

	List<ErpSellerStoreEmpower> selectEmpowerInUserName(List<String> list);

	Page<ErpSellerStoreEmpowerVo> selectAllVoPage(@Param("page")Page page);
	List<ErpSellerStoreEmpower> selectAllPage();

	ErpSellerStoreEmpower selectAllById(@Param("storeId") Long storeId);

//	Page<StoreStatisticalDataVo> selectEmpowerByErp(@Param("page") Page<Object> build,@Param("vo") StoreStatisticalDataVo vo);


	List<ErpSellerStoreEmpower> selectStoreListByUserId(@Param("userId")Long userId);

	List<ErpSellerStoreEmpower> selectListByCnCode(@Param("code") String storeUserName);

    List<String> getNowStoreUserName();

    List<ErpSellerStoreEmpower> selectAllList();
}
